package org.oslims.server.dao.hbm;

import java.util.List;

import org.hibernate.Query;
import org.oslims.domain.ParameterResult;
import org.oslims.server.dao.ParameterResultDao;

public class HbmParameterResultDao extends HbmGenericDao<ParameterResult, Long> implements ParameterResultDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<String> getParameterResultStatesForAnalysis(Long analysisResultId) {

		Query q = this.getSession().createQuery("select distinct pr.state from ParameterResult pr where pr.analysisResult.id = :analysisResultId)");
		q.setLong("analysisResultId", analysisResultId);

		return q.list();
	}

}
